import 'package:flutter/material.dart';
import 'package:leader_help/utils/util.dart';
import 'package:get/get.dart';

import '../index.dart';

class LogisticsListCell extends StatelessWidget {
  LogisticsListCell({Key? key}) : super(key: key);
  final controller = Get.find<LogisticsListController>();
  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: () => controller.actionCell(),
      child: Card(
        color: ColorsUtil.white,
        margin: EdgeInsets.symmetric(horizontal: 16.r, vertical: 0.r),
        child: Padding(
          padding: EdgeInsets.symmetric(horizontal: 16.r),
          child: Column(
            children: [
              Container(
                height: 40.r,
                decoration: const BoxDecoration(
                    border: Border(
                        bottom: BorderSide(color: ColorsUtil.separator))),
                child: Row(
                  children: [
                    loadAvater(size: 20.r),
                    Expanded(
                      child: Text(
                        '鳄梨先生',
                        style:
                            pfSCStyle(color: ColorsUtil.title, fontSize: 14.sp),
                      ),
                    ),
                    Icon(
                      Icons.arrow_forward_ios,
                      color: ColorsUtil.content,
                      size: 12.r,
                    )
                  ],
                ),
              ),
              SizedBox(
                height: 33.5,
                child: Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    Text(
                      '您的包裹已发货',
                      style:
                          pfSCStyle(color: ColorsUtil.title, fontSize: 16.sp),
                    ),
                    Text(
                      '21/12/10',
                      style:
                          pfSCStyle(color: ColorsUtil.content, fontSize: 12.sp),
                    ),
                  ],
                ),
              ),
              Container(
                height: 60.r,
                color: ColorsUtil.textBg,
                child: Row(
                  children: [
                    loadImage(width: 60.r, height: 60.r),
                    SizedBox(
                      width: 10.r,
                    ),
                    Expanded(
                      child: Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        mainAxisAlignment: MainAxisAlignment.center,
                        children: [
                          Text(
                            '您购买的“砀山酥梨”已装车，即将到达惠州市',
                            maxLines: 1,
                            overflow: TextOverflow.ellipsis,
                            style: pfMediumStyle(
                                color: const Color(0xff888888),
                                fontSize: 13.sp),
                          ),
                          SizedBox(
                            height: 3.r,
                          ),
                          Row(
                            children: [
                              Text(
                                '查看快递单号',
                                style: pfMediumStyle(
                                    color: const Color(0xff888888),
                                    fontSize: 13.sp),
                              ),
                              Icon(
                                IconUtil.arrow_right,
                                size: 10.r,
                                color: const Color(0xff888888),
                              )
                            ],
                          )
                        ],
                      ),
                    ),
                    SizedBox(
                      width: 10.r,
                    ),
                  ],
                ),
              ),
              SizedBox(
                height: 16.r,
              ),
            ],
          ),
        ),
      ),
    );
  }
}
